# -*- coding: utf-8 -*-

# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html


class DoubanHeaderMiddleWare:
    def process_request(self, request, spider):
        # request.headers = {
        #                     'Accept':'*/*',
        #                     'Accept-Encoding':'gzip, deflate, sdch, br',
        #                     'Accept-Language':'zh-CN,zh;q=0.8',
        #                     'Connection':'keep-alive',
        #                     'Cookie':'bid=hDlh1Q8C1ZQ; ll="108296"; douban-fav-remind=1; __yadk_uid=V82m4XU8iFxhTZZrB5o7CdlQr3T3AEcd; _pk_ref.100001.4cf6=%5B%22%22%2C%22%22%2C1533001441%2C%22http%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DUVPhkwlGO3hYJ3DyDHem8k5DjYb_xaMqJ2CycctqXyN4hOXWmnRoFE5u-lZgNndw%26wd%3D%26eqid%3Df4ade5ab00034a66000000025b5fbedb%22%5D; ps=y; __utmt=1; _ga=GA1.2.890975990.1532326623; _gid=GA1.2.833507661.1533001722; dbcl2="134382806:0mEPjk3nk2k"; ck=npIZ; ap=1; _vwo_uuid_v2=D143A06B4784FC8D7CD3D578B8AA2CE65|cf3357726dccff6795cd749a0b45771b; _pk_id.100001.4cf6=136c6649409fe0cd.1532937239.2.1533002022.1532937239.; _pk_ses.100001.4cf6=*; __utma=30149280.890975990.1532326623.1532937240.1533001441.3; __utmb=30149280.18.5.1533001941041; __utmc=30149280; __utmz=30149280.1533001441.3.3.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmv=30149280.13438; __utma=223695111.2048531714.1532937240.1532937240.1533001441.2; __utmb=223695111.0.10.1533001441; __utmc=223695111; __utmz=223695111.1533001441.2.2.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; push_noty_num=0; push_doumail_num=0',
        #                     'Host':'movie.douban.com',
        #                     'Referer':'https://movie.douban.com/subject/27605698/comments?start=20&limit=20&sort=new_score&status=P',
        #                     'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0',
        #                     'X-Requested-With':'XMLHttpRequest'
        #                 }
        request.headers['Accept']='*/*'
        request.headers['Accept-Encoding']='gzip, deflate, sdch, br'
        request.headers['Accept-Language']='zh-CN,zh;q=0.8'
        request.headers['Connection']='keep-alive'
        #request.headers['Cookie']='bid=hDlh1Q8C1ZQ; ll="108296"; douban-fav-remind=1; __yadk_uid=V82m4XU8iFxhTZZrB5o7CdlQr3T3AEcd; _pk_ref.100001.4cf6=%5B%22%22%2C%22%22%2C1533001441%2C%22http%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DUVPhkwlGO3hYJ3DyDHem8k5DjYb_xaMqJ2CycctqXyN4hOXWmnRoFE5u-lZgNndw%26wd%3D%26eqid%3Df4ade5ab00034a66000000025b5fbedb%22%5D; ps=y; __utmt=1; _ga=GA1.2.890975990.1532326623; _gid=GA1.2.833507661.1533001722; dbcl2="134382806:0mEPjk3nk2k"; ck=npIZ; ap=1; _vwo_uuid_v2=D143A06B4784FC8D7CD3D578B8AA2CE65|cf3357726dccff6795cd749a0b45771b; _pk_id.100001.4cf6=136c6649409fe0cd.1532937239.2.1533002022.1532937239.; _pk_ses.100001.4cf6=*; __utma=30149280.890975990.1532326623.1532937240.1533001441.3; __utmb=30149280.18.5.1533001941041; __utmc=30149280; __utmz=30149280.1533001441.3.3.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmv=30149280.13438; __utma=223695111.2048531714.1532937240.1532937240.1533001441.2; __utmb=223695111.0.10.1533001441; __utmc=223695111; __utmz=223695111.1533001441.2.2.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; push_noty_num=0; push_doumail_num=0'
        request.headers['Cookie']='Cookie:bid=hDlh1Q8C1ZQ; ll="108296"; douban-fav-remind=1; __yadk_uid=V82m4XU8iFxhTZZrB5o7CdlQr3T3AEcd; ps=y; _ga=GA1.2.890975990.1532326623; _gid=GA1.2.833507661.1533001722; dbcl2="134382806:0mEPjk3nk2k"; ck=npIZ; ap=1; _vwo_uuid_v2=D143A06B4784FC8D7CD3D578B8AA2CE65|cf3357726dccff6795cd749a0b45771b; _pk_ref.100001.4cf6=%5B%22%22%2C%22%22%2C1533004649%2C%22http%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DUVPhkwlGO3hYJ3DyDHem8k5DjYb_xaMqJ2CycctqXyN4hOXWmnRoFE5u-lZgNndw%26wd%3D%26eqid%3Df4ade5ab00034a66000000025b5fbedb%22%5D; _pk_id.100001.4cf6=136c6649409fe0cd.1532937239.3.1533004989.1533002022.; _pk_ses.100001.4cf6=*; __utma=30149280.890975990.1532326623.1533001441.1533004649.4; __utmb=30149280.0.10.1533004649; __utmc=30149280; __utmz=30149280.1533001441.3.3.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmv=30149280.13438; __utma=223695111.2048531714.1532937240.1533001441.1533004649.3; __utmb=223695111.0.10.1533004649; __utmc=223695111; __utmz=223695111.1533001441.2.2.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; push_noty_num=0; push_doumail_num=0'
        request.headers['Host']='movie.douban.com'
        request.headers['Referer']='https://movie.douban.com/subject/27605698/comments?start=20&limit=20&sort=new_score&status=P'
        request.headers['User-Agent']='Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0'
        request.headers['X-Requested-With']='XMLHttpRequest'